#include "mainwindow.h"
#include "idcardwgt.h"

#pragma execution_character_set("utf-8")
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{    

    this->setWindowFlags(Qt::FramelessWindowHint);

    QPalette pal;
    pal.setColor(QPalette::Background, Qt::white);
    setPalette(pal);

    m_pTitileBarWgt = new TitleBarWgt(this);
    m_pBottomBarWgt = new Bottombarwgt(this);
    m_pPhotoWgt = new PhotoWgt(this);
    m_pIDCardWgt = new IDCardWgt(this);  
}

MainWindow::~MainWindow()
{
}

void MainWindow::resizeEvent(QResizeEvent *event)
{
    QSize size = event->size();
    int nW = size.width();
    int nH = size.height();
    int nBarH = 60;
    int nBotH = 30;
    int nIdCardW = 300;

    m_pTitileBarWgt->setGeometry(0, 0, nW, nBarH);
    m_pBottomBarWgt->setGeometry(0, nH-nBotH, nW, nBotH);
    m_pIDCardWgt->setGeometry(0, nBarH, nIdCardW, nH-nBotH-nBarH);
    m_pPhotoWgt->setGeometry(nIdCardW, nBarH, nW-10-nIdCardW, nH-nBotH-nBarH);
    event->accept();
}

